package com.probiz.estore.common.model.product.base;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.product.Product;
import com.probiz.estore.common.model.system.AppUser;
import com.probiz.estore.core.model.BaseObject;

/**
 * StockNotify Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class StockNotifyTbl extends BaseObject implements Serializable {

    protected Integer stockNotifyId;
	protected AppUser customer;
	protected String customerName;
	protected String email;
	protected String phone;
	protected String memo;
	protected java.util.Date createTime;
	protected java.util.Date informTime;
	protected Short informStatus;
	protected Product product;


	/**
	 * Default Empty Constructor for class StockNotify
	 */
	public StockNotifyTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class StockNotify
	 */
	public StockNotifyTbl (
		 Integer stockNotifyId
        ) {
		this.setStockNotifyId(stockNotifyId);
    }

	
	public Product getProduct () {
		return product;
	}	
	
	public void setProduct (Product in_product) {
		this.product = in_product;
	}
    
	public AppUser getCustomer() {
		return customer;
	}

	public void setCustomer(AppUser customer) {
		this.customer = customer;
	}
	
	/**
	 */
	public Integer getCustomerId() {
		return this.getCustomer()==null?null:this.getCustomer().getAppuserId();
	}
	
	/**
	 * Set the managerId
	 */	
	public void setCustomerId(Integer aValue) {
	    if (aValue==null) {
	    	customer = null;
	    } else {
	    	customer = new AppUser(aValue);
	    	customer.setVersion(Integer.valueOf(0));//set a version to cheat hibernate only
	    }
	}	
	

	/**
	 * 客户名称	 * @return String
	 * @hibernate.property column="customerName" type="java.lang.String" length="32" not-null="false" unique="false"
	 */
	public String getCustomerName() {
		return this.customerName;
	}
	
	/**
	 * Set the customerName
	 */	
	public void setCustomerName(String aValue) {
		this.customerName = aValue;
	}	

	/**
	 * 商品id	 * @return Integer
	 */
	public Integer getProductId() {
		return this.getProduct()==null?null:this.getProduct().getProductId();
	}
	
	/**
	 * Set the productId
	 */	
	public void setProductId(Integer aValue) {
	    if (aValue==null) {
	    	product = null;
	    } else {
	        product = new Product(aValue);
	        product.setVersion(Integer.valueOf(0));//set a version to cheat hibernate only
	    }
	}	

	/**
	 * 客户邮件	 * @return String
	 * @hibernate.property column="email" type="java.lang.String" length="64" not-null="false" unique="false"
	 */
	public String getEmail() {
		return this.email;
	}
	
	/**
	 * Set the email
	 */	
	public void setEmail(String aValue) {
		this.email = aValue;
	}	

	/**
	 * 电话号码	 * @return String
	 * @hibernate.property column="phone" type="java.lang.String" length="32" not-null="false" unique="false"
	 */
	public String getPhone() {
		return this.phone;
	}
	
	/**
	 * Set the phone
	 */	
	public void setPhone(String aValue) {
		this.phone = aValue;
	}	

	/**
	 * 留言	 * @return String
	 * @hibernate.property column="memo" type="java.lang.String" length="256" not-null="false" unique="false"
	 */
	public String getMemo() {
		return this.memo;
	}
	
	/**
	 * Set the memo
	 */	
	public void setMemo(String aValue) {
		this.memo = aValue;
	}	

	/**
	 * 登记时间	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="19" not-null="false" unique="false"
	 */
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * Set the createTime
	 */	
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}	

	/**
	 * 通知时间	 * @return java.util.Date
	 * @hibernate.property column="informTime" type="java.util.Date" length="19" not-null="false" unique="false"
	 */
	public java.util.Date getInformTime() {
		return this.informTime;
	}
	
	/**
	 * Set the informTime
	 */	
	public void setInformTime(java.util.Date aValue) {
		this.informTime = aValue;
	}	

	

	public Short getInformStatus() {
		return informStatus;
	}

	public void setInformStatus(Short informStatus) {
		this.informStatus = informStatus;
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof StockNotifyTbl)) {
			return false;
		}
		StockNotifyTbl rhs = (StockNotifyTbl) object;
		return new EqualsBuilder()
				.append(this.stockNotifyId, rhs.stockNotifyId)
				.append(this.customerName, rhs.customerName)
						.append(this.email, rhs.email)
				.append(this.phone, rhs.phone)
				.append(this.memo, rhs.memo)
				.append(this.createTime, rhs.createTime)
				.append(this.informTime, rhs.informTime)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.stockNotifyId) 
				.append(this.customerName) 
						.append(this.email) 
				.append(this.phone) 
				.append(this.memo) 
				.append(this.createTime) 
				.append(this.informTime) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("stockNotifyId", this.stockNotifyId) 
				.append("customerName", this.customerName) 
						.append("email", this.email) 
				.append("phone", this.phone) 
				.append("memo", this.memo) 
				.append("createTime", this.createTime) 
				.append("informTime", this.informTime) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "stockNotifyId";
	}
	
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return stockNotifyId;
	}

	public Integer getStockNotifyId() {
		return stockNotifyId;
	}

	public void setStockNotifyId(Integer stockNotifyId) {
		this.stockNotifyId = stockNotifyId;
	}

}